package com.qingxin.sms.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.qingxin.sys.entity.BaseEntity;

/**
 * 短信验证码
 * @author Administrator
 *
 */
@Entity
@Table(name = "sms_authcode")
public class SmsAuthcode extends BaseEntity implements java.io.Serializable {
	private static final long serialVersionUID = 8960712099492099067L;
	
	private String id;
	private String phone;
	private String authCode;
	private Integer codeType;//验证码类型：默认1
	private Integer codeStatus;//状态：0未发送，1已发送，2已验证，3已验证（失败）
	private Date createTime;
	private Date sendTime;
	private Date authTime;//验证时间
	
	public SmsAuthcode() {
	}
	
	
	public SmsAuthcode(String id, String phone, String authCode,
			Integer codeType, Integer codeStatus, Date createTime,
			Date sendTime, Date authTime) {
		this.id = id;
		this.phone = phone;
		this.authCode = authCode;
		this.codeType = codeType;
		this.codeStatus = codeStatus;
		this.createTime = createTime;
		this.sendTime = sendTime;
		this.authTime = authTime;
	}


	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "id", unique = true, nullable = false, length = 32)
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	
	@Column(name = "phone", length = 20)
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	
	@Column(name = "auth_code", length = 20)
	public String getAuthCode() {
		return authCode;
	}
	public void setAuthCode(String authCode) {
		this.authCode = authCode;
	}
	
	@Column(name = "code_type")
	public Integer getCodeType() {
		return codeType;
	}
	public void setCodeType(Integer codeType) {
		this.codeType = codeType;
	}
	
	@Column(name = "code_status")
	public Integer getCodeStatus() {
		return codeStatus;
	}
	public void setCodeStatus(Integer codeStatus) {
		this.codeStatus = codeStatus;
	}
	
	@Column(name = "create_time", length = 23)
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Column(name = "send_time", length = 23)
	public Date getSendTime() {
		return sendTime;
	}
	public void setSendTime(Date sendTime) {
		this.sendTime = sendTime;
	}

	@Column(name = "auth_time", length = 23)
	public Date getAuthTime() {
		return authTime;
	}
	public void setAuthTime(Date authTime) {
		this.authTime = authTime;
	}
	
	
}
